﻿// Copyright (c) ZhangPeihang. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.Extensions.Options;
using LaserMark.ModbusTCP.Abstraction;
using LaserMark.ModbusTCP.Config;

namespace LaserMark.ModbusTCP;
public class MasterClientFactory : IMasterClientFactory
{
    [NotNull]
    private IOptions<ModBusOption> Options { get; set; }

    public MasterClientFactory(IOptions<ModBusOption> options)
    {
        Options = options;
    }

    public ModBusMaster Create()
    {
        return new ModBusMaster(Options);
    }
}
